﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SamplePlugins
{
    public partial class OpeningHoursConfigurationForm : Form
    {
        int m_from;
        int m_to;

        public OpeningHoursConfigurationForm()
        {
            InitializeComponent();
            m_from = 0;
            m_to = 0;    // midnight to midnight

            timeFrom.SetTimeFromInteger(m_from);
            timeTo.SetTimeFromInteger(m_to);
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            m_from = timeFrom.GetTimeAsInteger();
            m_to = timeTo.GetTimeAsInteger();
        }
        
        public int OpenFrom
        {
            get { return m_from; }
            set { timeFrom.SetTimeFromInteger(value); m_from = value; }
        }

        public int OpenTo
        {
            get { return m_to; }
            set { timeTo.SetTimeFromInteger(value); m_to = value; }
        }
    }
}
